package com.rui.study.micro.oauth2.config;

import org.springframework.context.annotation.Configuration;

@Configuration
public class MyFeignConfiguration {

//    @Bean
//    @Primary
//    public KeyApi feignBuilder(Decoder decoder, Encoder encoder, Client client, Contract contract) {
//        return HystrixFeign.builder()
//                .client(client)
//                .encoder(encoder)
//                .decoder(decoder)
//                .contract(contract)
//                .requestInterceptor(new BasicAuthRequestInterceptor("user", "user"))
//                .target(KeyApi.class, "http://com.rui.study.micro.key.manage");
//    }

//    public KeyApi feignBuilder() {
//        return HystrixFeign.builder()
//                .client(new OkHttpClient())
//                .encoder(new Encoder.Default())
//                .decoder(new Decoder.Default())
//                .contract(new feign.Contract.Default())
//                .requestInterceptor(new BasicAuthRequestInterceptor("user", "user"))
//                .target(KeyApi.class, "http://com.rui.study.micro.key.manage");
//    }
//
//    public static void main(String[] args) {
//
//    }
}
